﻿using Abp.Runtime;
using System;

namespace AbpProjectTemplate.Components.Configuration
{
    public class AutoSettingsTenantAndUserOverride
    {
        public int? TentantId { get; set; }

        public long? UserId { get; set; }

        //public AutoSettingsTenantAndUserOverride(int? tenantId)
        //{
        //    this.TentantId = tenantId;
        //}
        //public AutoSettingsTenantAndUserOverride(long? userId)
        //{
        //    this.UserId = userId;
        //}
        public AutoSettingsTenantAndUserOverride(int? tenantId, long? userId)
        {
            this.TentantId = tenantId;
            this.UserId = userId;
        }
    }

    /// <summary>
    /// 自动设置的租户及用户提供者，用于设置时为租户/用户设置
    /// </summary>
    public interface IAutoSettingsTenantAndUserProvider
    {
        public int? TenantId { get; }

        public long? UserId { get; }

        //IDisposable UseTenant(int? tenantId);

        //IDisposable UseUser(long? userId);

        IDisposable Use(long? userId, int? tenantId = null);
    }
}
